<?php

if (isset($_POST['submit_invest']))
{
	$an = stripslashes(@$_POST['title']);
	$ad = stripslashes(@$_POST['formdesc']);
	$a_n = stripslashes(@$_POST['formvalues']);

	@session_start();
	$access_token = $_SESSION['access_token'];
	$suser = $access_token['user_id'];

//need to write to client's file
$topdir = "/home/boostpo1/public_html/chirplace.com/usr/".$suser."/forms/".$an.".php";
$fh = fopen($topdir, 'w');
fwrite($fh, "<?php\n\r\$formname = \"$an\";\n\r\$formdescription = \"$ad\";\n\r\$formauthor = \"Harry\";\n\r\$formauthorurl = \"http://www.harry.com\";\n\r\$formavatar = \"http://www.boostpost.com/chirplace.com/images/cplogo.gif\";\n\r\$formentry = array($a_n);\n\r?>");
fclose($fh);
}

header("Location:index.php?start=forms");
?>